/*
 * File Created: 2019-12-02 11:57:01
 * Author: 余保林 (yubaolin6@outlook.com)
 * Desc: 渠道商管理
 * Last Modified: 2019-12-02 12:39:01
 * Modified By: 余保林 (yubaolin6@outlook.com>)
 */

import request from '@/utils/request'
import Qs from 'qs'

export function channelQuery(params, data) {
  return request.get(`/platform/channel/query?${Qs.stringify(params)}`)
}

export function channelAdd(data) {
  return request.post('/platform/channels', data)
}

export function channelEdit(data) {
  return request.patch(`/platform/channels/${data.id}/profile`, data)
}

/**
 * 获取渠道商详情
 *
 * @export
 * @param {*} id
 * @returns
 */
export function channelDetail(id) {
  return request.get(`/platform/channels/${id}/profile`)
}

export function channelAll() {
  return request.get('/platform/channels')
}


export const uploadChannelUrl = '/platform/channel/logo/upload'